Hi scripting gurus!
I'm having a problem with my companions who fly (pixies) as a racial ability. Is there a way to get them to stay on the same level when we're just walking? Right now, when I walk down a hill, they just keep walking on the same level so they end up above me, but not far enough above me that the teleporting part of the companion script kicks in.
I don't want to remove their flying abilities because later in the TC the player will be able to levitate a lot, and I want the player to be able to keep the companions if they choose to.
I also don't want to set the teleport distance so ridiculously low that my companions will constantly be teleporting to me.
Is there a way to make them fly only when the player is levitating?
Here's the script I've been using...I'd like to improve it anyway because it's old and I didn't write it , so any suggestions would be helpful.
Code:
Begin 0buddyScript
short companion
short Nolore
short float
float myx
float myy
float myz
float timer
AddTopic "Join My Big Adventure!"
;addspell 0buddylevitate
if ( GetCurrentAiPackage == 3 )
if ( GetWeaponDrawn )
elseif ( GetSpellReadied )
return
elseif ( GetDistance Player > 999 )
set timer to timer + GetSecondsPassed
if ( timer > 9 )
set timer to 0
set myx to ( Player->GetPos x )
set myy to ( Player->GetPos y )
set myz to ( Player->GetPos z )
SetPos x myx
SetPos y myy
SetPos z myz
endif
endif
endif
if ( GetCurrentAiPackage == 3 )
if ( Player->GetEffect, sEffectLevitate == 1 )
if ( GetEffect, sEffectLevitate == 0 )
Cast 0buddylevitate player
endif
if ( GetEffect, sEffectLevitate == 1 )
set myz to ( Player->GetPos z )
SetPos z myz
endif
endif
endif
endif
END
Post Extras: